Wrapper
Represents an abstract wrapper class for a value of type that supports equality, cloning, and disposal.
Erbt von: Equatable<Wrapper<T>>
Implementiert: IDisposable
Konstruktoren
protected Wrapper(T value)
wrapper = Wrapper(value)
Initializes a new instance of the Wrapper class with the specified value.
- value
- The value to wrap.
Eigenschaften
public bool HasValue { get; }
value = wrapper.HasValue
Gets a value indicating whether the wrapped value is not equal to the default value of type .
public bool IsDisposed { get; private set; }
value = wrapper.IsDisposed
wrapper.IsDisposed = value
Gets a value indicating whether this instance has already been disposed.
public virtual T Value { get; set; }
value = wrapper.Value
wrapper.Value = value
Gets or sets the wrapped value.
Methoden
public void Dispose()
wrapper.Dispose()
Releases all resources used by the current instance.
protected virtual void DisposeManaged()
wrapper.DisposeManaged()
Releases managed resources used by the current instance.
protected virtual void DisposeNative()
wrapper.DisposeNative()
Releases unmanaged (native) resources used by the current instance.
protected override void Finalize()
wrapper.Finalize()
Finalizes an instance of the Wrapper class.
public override int GetHashCode()
result = wrapper.GetHashCode()
Returns a hash code for this instance based on the wrapped value.
Rückgabe: A hash code for the current object.
protected override bool OnEquals(Wrapper<T> other)
result = wrapper.OnEquals(other)
Determines whether the wrapped value of this instance equals the wrapped value of another instance.
- other
- Another instance of Wrapper to compare with.
Rückgabe: true if the wrapped values are equal; otherwise, false.
op_Explicit(Wrapper{) : T
Defines an explicit conversion operator from Wrapper to .
- wrapper
- The wrapper instance.
Rückgabe: The wrapped value.
public override string ToString()
result = wrapper.ToString()
Returns a string that represents the current instance.
Rückgabe: A string representation of the wrapped value, or an empty string if no value is present.